package server;

import io.netty.handler.codec.http.HttpMethod;

public abstract class HttpServlet implements Servlet{


    public abstract void doGet(Request request,Response response);

    public abstract void doPost(Request request,Response response);
    @Override
    public void service(Request request, Response response) throws Exception {
        if(HttpMethod.GET == request.getHttpMethod()){
            doGet(request,response);
        } else if("GET".equalsIgnoreCase(request.getMethod())) {
            doGet(request,response);
        }else{
            doPost(request,response);
        }
    }
}
